package com.drug.service.impl;

import com.drug.domain.DrugInformation;
import com.drug.domain.Result;
import com.drug.domain.SdiDiInf;
import com.drug.mapper.DrugInformationMapper;
import com.drug.mapper.SdiDiInfMapper;
import com.drug.service.SdiDiInfService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SdiDiInfServiceImpl implements SdiDiInfService {

    @Autowired
    private SdiDiInfMapper sdiDiInfMapper;
    @Autowired
    private DrugInformationMapper drugInformationMapper;


    @Override
    public Result updateSubmit(SdiDiInf sdiDiInf) {
        Result result = new Result();
        int i = sdiDiInfMapper.updateSubmit(sdiDiInf);
        if(i == 1){
            result.setMsg("修改成功");
        }else{
            result.setMsg("修改失败");
        }
        return result;
    }

    /**
     *
     * @param str 状态
     * @param integer id
     */
    @Override
    public void updateSubmitDi(String str, Integer integer) {
       Integer id= sdiDiInfMapper.selectDiId(integer);
        drugInformationMapper.updateSdiMen(id,str);
    }
}
